<template>
  <div class="card-list">
    <div @click="router.push(item.url)" class="card-item" v-for="(item,index) in props.list" :key="index">
      <img :src="item.img">
      <div class="title">{{ item.title }}</div>
    </div>
  </div>
</template>
<script setup>
import {useRouter} from 'vue-router'
import {useDataStore} from "@/stores/dataStore"

const dataStore = useDataStore()

const router = useRouter()
//传递过来的数据
const props = defineProps(['list'])
</script>
<style scoped lang="scss">
.card-list {
  display: flex;
  flex-wrap: wrap;
  padding: 5px;

  .card-item {
    background-color: #ffffff;
    padding: 20px;
    margin: 3px;
    border-radius: 15px;
    display: flex;

    img {
      margin-left: 10px;
      height: 50px;
      width: 50px;
    }

    .title {
      line-height: 50px;
      font-weight: bolder;
      margin-left: 10px;
      width: 65px;
      font-size: 12px;
      font-family: 楷体;
    }
  }
}
</style>
